/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxline.clinicplus.entity;

import com.sun.faces.util.CollectionsUtils;
import java.io.Serializable;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import javax.persistence.*;

/**
 *
 * @author roniere
 */
@Entity
public class TemplateAppraisal implements Serializable {
    
    @Id
    @SequenceGenerator(sequenceName = "seq_template_appraisal", name = "seq_template_appraisal", allocationSize = 1)
    @GeneratedValue(generator = "seq_template_appraisal", strategy = GenerationType.SEQUENCE)
    private Long id;
    
    private String name;
    
    @ManyToMany
    private List<Procedure> procedures;
    
    @OneToMany(cascade= {CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REFRESH, CascadeType.DETACH})
    private List<Category> categorys;
    
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date createAt;
    
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date updateAt;

    @ManyToOne
    private SystemUser systemUser;
    
    @ManyToOne
    private SystemUser systemUserUpdate;

    
    @Lob
    private String textModel;

    public String getTextModel() {
        return textModel;
    }

    public void setTextModel(String textModel) {
        this.textModel = textModel;
    }
    
    
    public SystemUser getSystemUser() {
        return systemUser;
    }

    public void setSystemUser(SystemUser systemUser) {
        this.systemUser = systemUser;
    }

    public SystemUser getSystemUserUpdate() {
        return systemUserUpdate;
    }

    public void setSystemUserUpdate(SystemUser systemUserUpdate) {
        this.systemUserUpdate = systemUserUpdate;
    }

    public Date getUpdateAt() {
        return updateAt;
    }

    public void setUpdateAt(Date updateAt) {
        this.updateAt = updateAt;
    }
    
    public Date getCreateAt() {
        return createAt;
    }

    public void setCreateAt(Date createAt) {
        this.createAt = createAt;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Procedure> getProcedures() {
        return procedures;
    }

    public void setProcedures(List<Procedure> procedures) {
        this.procedures = procedures;
    }

    public List<Category> getCategorys() {
        //Collections.reverse(categorys);
        return categorys;
    }

    public void setCategorys(List<Category> categorys) {
        this.categorys = categorys;
    }
    
}
